package com.lwx.test;

import java.util.Arrays;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class ExtractNumberDemo {
    public static void main(String[] args) {
        extractNumber("love23next234csdn3423javaeye");
    }
    public static void extractNumber(String s){
        String regEx="[^0-9]";
        Pattern p = Pattern.compile(regEx);
        Matcher m = p.matcher(s);
        String s1 = m.replaceAll(" ").trim();
        System.out.println(s1);
        String[] split = s1.split("\\ ");
        System.out.println(Arrays.toString(split));
    }
}

